import { http } from "@/utils/http";
export function getDictPageList(data: Partial<ShopDictPageRequest & PageRequest>) {
  return http.post<MResponse<PageVo<Array<ShopDictVo>>>>("/user/dict/getDictPageList", { data });
}
export function getDictList(data?: Partial<ShopDictPageRequest>) {
  return http.post<MResponse<Array<ShopDictVo>>>("/user/dict/getDictList", { data });
}

export function addDict(data: ShopDictAddRequest) {
  return http.postJson<MResponse>("/user/dict/addDict", { data });
}

export function updateDict(data: ShopDictUpdateRequest) {
  return http.postJson<MResponse>("/user/dict/updateDict", { data });
}

export function delDict(data: ShopDictDelRequest) {
  return http.post<MResponse>("/user/dict/delDict", { data });
}

export function getDictTree(type?: string) {
  return http.post<MResponse<Array<ShopDictTreeVo>>>("/user/dict/getDictTree", { data: { type } });
}
